export function isEmpty(...arg){
    for (let i = 0; i < arg.length; i++) {
        if(arg[i] == null || arg[i] == undefined || arg[i] == '') return true;
    }
    return false;
}

export function encryption(keyStr, password){
    let key = 0;
    for (let i = 0; i < keyStr.length; i++) {
        key = key ^ keyStr.charCodeAt(i);
    }
    let epassword = "";
    for (let i = 0; i < password.length; i++) {
        epassword = epassword + String.fromCharCode(password.charCodeAt(i) ^ key);
    }
    return epassword;
}

export function isLogin(){
    let token = sessionStorage.getItem("authorization")
    if(token == undefined || token == ""){
        return false;
    }
    return true;
}

export default {
    isEmpty,
    encryption,
    isLogin
}